<template>
  <div class="input">
    <a-input-search
      size="normal"
      placeholder="请输入查询交通事故信息"
      @pressEnter="onSearch"
      @search="onSearch"
    />
  </div>
</template>

<script setup>
import mitt from '@/mitt'
const eventType = ['碰撞', '刮擦', '失火', '翻车', '碾压', '其他']

const onSearch = (e) => {
  if (eventType.includes(e)) {
    mitt.emit('onSearch', e)
  } else if (!e) {
    mitt.emit('unSearch')
  }
}
</script>

<style></style>
